package showtime.framework.engine.input
{
	import flash.events.KeyboardEvent;
	
	import showtime.framework.engine.World2D;

	public class KeyboardDevice extends InputDevice
	{
		public static const NUM_INPUTS:int = 223;
		
		public function KeyboardDevice()
		{
			super(NUM_INPUTS);
		}
		
		public function onKeyDown(event:KeyboardEvent):void
		{
			if (event.keyCode >= NUM_INPUTS || keys[event.keyCode] > 0)
			{
				return;
			}
			
			keys[event.keyCode] = World2D.now;
		}
		
		public function onKeyUp(event:KeyboardEvent):void
		{
			if (event.keyCode >= NUM_INPUTS)
			{
				return;
			}
			
			keys[event.keyCode] = -World2D.now;
		}
	}
}